#pragma once
#include "afxcmn.h"

// CDlgChangeLibrary dialog

class CDlgChangeLibrary : public CDialog
{
	DECLARE_DYNAMIC(CDlgChangeLibrary)

public:
	CDlgChangeLibrary(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDlgChangeLibrary();
	virtual BOOL OnInitDialog();
	virtual void OnOK();

	afx_msg void OnLvnItemchangedListLibraries(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLvnGetdispinfoListLibraries(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMCustomdrawListLibraries(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLvnGetInfoTipListLibraries(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMDblclkListLibraries(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLvnOdfinditemListLibraries(NMHDR *pNMHDR, LRESULT *pResult);

// Dialog Data
	enum { IDD = IDD_DIALOG_CHANGE_LIBRARY };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

public:
	enum LIBRARY_CHANGE_TYPE{ TYPE_CHANGE, TYPE_SENDTO, TYPE_DIVERT };
	enum LIBRARY_LIST{ LIST_DIVERT, LIST_NAME, LIST_PROBLEM, LIST_ILL };
	enum LIBRARY_LIST_ICON{ ICON_LIBRARY_NONE=-1, ICON_LIBRARY_BLANK=0, ICON_LIBRARY_PROBLEM, ICON_LIBRARY_LENDING_ILL, ICON_LIBRARY_BORROWING_ILL, ICON_LIBRARY_DIVERTED };

private:
	BOOL LoadItemIcons();
	INT GetItemImage(INT nItemId, INT nColumn);
	BOOL GetItemHighlight(LONG nItemId, INT nColumn, LPCOLORREF pclrText, LPCOLORREF pclrTextBk, PINT pnWeight, PBOOL pbItalic, PBOOL pbUnderline);

public:
	BOOL m_nType;
	LONG m_nStaffID;
	LONG m_nCurrentLibrary;
	LONG m_nNewLibrary;
	LONG m_nSelectedLibrary;
	BOOL m_bIndicator;
	BOOL m_bRetainStatus;
	INT m_nCurrentSort;
	BOOL m_bSortAscending;
	CImageList m_ilImages;
	CListCtrl m_ctrlLibraries;
	CArray<LIBRARY_LOOKUP> m_aLibraryList;
};
